import { BaseType } from '../index';


export interface RbacConfig {
  current: (role: boolean, permission: boolean) => Promise<{ roles: BaseType[], permissions: BaseType[] }>
  minRole: string
  permission: boolean
  role: boolean
  root: boolean
}

export const rbacConfig: RbacConfig = {
  current: (): Promise<{ roles: BaseType[], permissions: BaseType[] }> => new Promise((resolve) => resolve({
    permissions: [],
    roles: [],
  })),
  minRole: window.dmyConfig?.rbac?.minRole ?? '',
  permission: window.dmyConfig?.rbac?.permission ?? false,
  role: window.dmyConfig?.rbac?.role ?? false,
  root: window.dmyConfig?.rbac?.root ?? true,
}
